<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        //实参为基本数据类型，函数形参无法改变实参的值
        var a = 1;
        function test (x) {
            x = 2;
            console.log(x,a);
        }    
        test(a);
        //实参为引用类型，函数的形参会改变实参的值
        var obj = {x:0}
        function bar (obj1){
            obj1.x = 2;
            console.log(obj,obj1);
        }
        bar (obj);
        //自己完成拷贝数据函数
        function Copy (data) {
            var copy;
            switch(true){
                //分情况
            }
        }
    </script>
</body>
</html>